home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / SYS / libs / reqbase.h < prev    next >
C/C++ Source or Header  |  1996-09-26  |  13KB  |  338 lines

  1.  
  2. /* reqlibrary.h (c) 1988/1989 reserved by Colin Fox and Bruce Dawson */
  3.  
  4. #ifndef REQLIBRARY_H
  5. #define REQLIBRARY_H
  6.  
  7. #define    REQVERSION    1
  8.  
  9.  
  10. #define    NUMPAIRS    10
  11.  
  12. struct GadgetBlock
  13.     {
  14.     struct Gadget        Gadget;
  15.     struct Border        Border;
  16.     WORD                Pairs[NUMPAIRS];
  17.     struct IntuiText    Text;
  18.     };
  19.  
  20. struct StringBlock
  21.     {
  22.     struct Gadget        Gadget;
  23.     struct StringInfo    Info;
  24.     struct Border        Border;
  25.     WORD                Pairs[NUMPAIRS];
  26.     };
  27.  
  28. struct PropBlock
  29.     {
  30.     struct Gadget        Gadget;
  31.     struct PropInfo        Info;
  32.     struct Image        Image;
  33.     };
  34.  
  35. struct ScrollBlock
  36.     {
  37.     struct Gadget        ArrowUpLt;
  38.     struct Image        ImageUpLt;
  39.     struct Gadget        ArrowDnRt;
  40.     struct Image        ImageDnRt;
  41.     struct PropBlock    Prop;
  42.     };
  43.  
  44. struct TwoImageGadget
  45.     {
  46.     struct Gadget        Gadget;
  47.     struct Image        Image1;
  48.     struct Image        Image2;
  49.     };
  50.  
  51. #define    ATTITUDEB    16
  52.  
  53. #define    HORIZSLIDER        (0L<<ATTITUDEB)    /*;which way the slider stands*/
  54. #define    VERTSLIDER        (1L<<ATTITUDEB)    /*;This is so that it bypasses all gadget flags.*/
  55.  
  56.  
  57.  
  58. /*;         This structure is use with the TextRequester function.*/
  59.  
  60. struct TRStructure
  61.     {
  62.     char    *Text;            /* ;This is the message text, including printf() style formatting if desired.*/
  63.     char    *Controls;        /* ;This is the address of the parameter list, if printf() style formatting is used.*/
  64.     struct Window    *Window;/* ;This is an optional (zero if not used) pointer to a window on the screen you*/
  65.                             /* ;would like the requester to show up on.*/
  66.     char    *MiddleText;    /* ;If non-zero, this is the text for the gadget in the lower middle (returns 2).*/
  67.     char    *PositiveText;    /* ;If non-zero, this is the text for the gadget in the lower left hand corner (returns 1).*/
  68.     char    *NegativeText;    /* ;If non-zero, this is the text for the gadget in the lower right (returns 0).*/
  69.     char    *Title;            /* ;This is the title for the window.*/
  70.     WORD    KeyMask;        /* ;This is the qualifier mask for the keyboard shortcuts.*/
  71.                             /* ;Use $FFFF to allow any qualifiers (or none).*/
  72.                             /* ;Zero means that no keyboard shortcuts are allowed.*/
  73.     WORD    textcolor;        /* ;Color of the text.  Uses color 1 if no color specified. */
  74.     WORD    detailcolor;    /* ;Detail and block color, as in a NewWindow structure.  If */
  75.     WORD    blockcolor;        /* ;both are left zero, block pen will be set to 1. */
  76.     WORD    versionnumber;    /* ;Make SURE this is set to zero. */
  77.     LONG    rfu1;            /* ;Make SURE you leave these two zeroed also. */
  78.     LONG    rfu2;            /* ;Make SURE you leave these two zeroed also. */
  79.     };
  80.  
  81. /* NOTE:
  82.  
  83.     The  control  values  mentioned above are used if you choose to insert
  84. printf  style directives in your strings and should contain the address of
  85. a list of control parameters, usually on the stack.
  86.     */
  87.  
  88.  
  89.  
  90. /*;         Remember,   if  you  don't  want  to  go  through  the  hassle  of */
  91. /*; initializing a ExtendedColorRequester structure, you can always just call */
  92. /*; ColorRequester  (as opposed to ExtendedColorRequester).  ColorRequester */
  93. /*; just  takes  a  single  parameter, in D0, the color that should start out */
  94. /*; being highlit.  It returns a single value, the color that was selected at */
  95. /*; the end.
  96.  
  97. /*;         This structure is for use with the ExtendedColorRequester (_not_, */
  98. /*; the ColorRequester) function. */
  99.  
  100. struct ExtendedColorRequester
  101.     {
  102.     LONG    defcolor;        /*;The color that is initially highlit. */
  103.     APTR    window;            /*;The window the 'requester' opens up in. */
  104.     LONG    rfu1;            /*;Who knows what these will be used for, */
  105.     LONG    rfu2;            /*;but I'm sure we'll think of something. */
  106.     LONG    rfu3;            /*;Until then, just keep these zeroed. */
  107.     LONG    rfu4;            /*;Okay? */
  108.     LONG    rfu5;
  109.     };
  110.  
  111.  
  112.  
  113. /*;         This structure is for use with the GetLong function.*/
  114.  
  115. #define    GLNODEFAULTB    0    /*;Set this bit in the flags if you don't want a default*/
  116.                             /*;value to show up in the get long string gadget.  For*/
  117.                             /*;some things this is much better than having a zero*/
  118.                             /*;show up.*/
  119.  
  120. #define    GLNODEFAULTM    (1<<GLNODEFAULTB)
  121.  
  122. struct GetLongStruct
  123.     {
  124.     char    *titlebar;
  125.     LONG    defaultval;
  126.     LONG    minlimit;
  127.     LONG    maxlimit;
  128.     LONG    result;
  129.     struct Window    *window;
  130.     WORD    versionnumber;    /* ;Make SURE this is set to zero. */
  131.     LONG    flags;            /* Some, uh flags.  See above for bit definitions. */
  132.     LONG    rfu2;            /* ;Make SURE you leave these two zeroed also. */
  133.     };
  134.  
  135.  
  136.  
  137. #ifndef    DSIZE
  138. #define    DSIZE    130
  139. #define    FCHARS    30
  140. #endif
  141. #define    WILDLENGTH    30
  142.  
  143. #define    FRQSHOWINFOB    0    /*;Set this in Flags if you want .info files to show.  They default to hidden.*/
  144. #define    FRQEXTSELECTB    1    /*;Set this in Flags if you want extended select.  Default is not.*/
  145. #define    FRQCACHINGB        2    /*;Set this in Flags if you want directory caching.  Default is not.*/
  146. #define    FRQGETFONTSB    3    /*;Set this in Flags if you want a font requester rather than a file requester.*/
  147. #define    FRQINFOGADGETB    4    /*;Set this in Flags if you want a hide-info files gadget.*/
  148. #define    FRQHIDEWILDSB    5    /*;Set this in Flags if you DON'T want 'show' and 'hide' string gadgets.*/
  149. #define    FRQABSOLUTEXYB    6    /*;Use absolute x,y positions rather than centering on mouse.*/
  150. #define    FRQCACHEPURGEB    7    /*;Purge the cache whenever the directory date stamp changes if this is set.*/
  151. #define    FRQNOHALFCACHEB    8    /*;Don't cache a directory unless it is completely read in when this is set.*/
  152. #define    FRQNOSORTB        9    /*;Set this in Flags if you DON'T want sorted directories.*/
  153. #define    FRQNODRAGB        10    /*;Set this in Flags if you DON'T want a drag bar and depth gadgets.*/
  154. #define    FRQSAVINGB        11    /*;Set this bit if you are selecting a file to save to.*/
  155. #define    FRQLOADINGB        12    /*;Set this bit if you are selecting a file(s) to load from.*/
  156.                             /*;These two bits (save and load) aren't currently used for*/
  157.                             /*;anything, but they may be in the future, so you should*/
  158.                             /*;remember to set them.  Also, these bits make it easier if*/
  159.                             /*;somebody wants to customize the file requester for their*/
  160.                             /*;machine.  They can make it behave differently for loading*/
  161.                             /*;vs saving.*/
  162.  
  163. #define    FRQSHOWINFOM    (1<<FRQSHOWINFOB)
  164. #define    FRQEXTSELECTM    (1<<FRQEXTSELECTB)
  165. #define    FRQCACHINGM        (1<<FRQCACHINGB)
  166. #define    FRQGETFONTSM    (1<<FRQGETFONTSB)
  167. #define    FRQINFOGADGETM    (1<<FRQINFOGADGETB)
  168. #define    FRQHIDEWILDSM    (1<<FRQHIDEWILDSB)
  169. #define    FRQABSOLUTEXYM    (1<<FRQABSOLUTEXYB)
  170. #define    FRQCACHEPURGEM    (1<<FRQCACHEPURGEB)
  171. #define    FRQNOHALFCACHEM    (1<<FRQNOHALFCACHEB)
  172. #define    FRQNOSORTM        (1<<FRQNOSORTB)
  173. #define    FRQNODRAGM        (1<<FRQNODRAGB)
  174. #define    FRQSAVINGM        (1<<FRQSAVINGB)
  175. #define    FRQLOADINGM        (1<<FRQLOADINGB)
  176.  
  177. struct ESStructure
  178.     {
  179.     struct ESStructure    *NextFile;
  180.     WORD    NameLength;            /* Length of thefilename field, not including the terminating zero. */
  181.     WORD    Pad;
  182.     APTR    Node;                /* For internal use only. */
  183.     char    thefilename[1];        /* This is a variable size field. */
  184.     };
  185.  
  186. struct FileRequester
  187.     {
  188.     UWORD    VersionNumber;                /* Make sure this is zeroed for now. */
  189.  
  190.     char    *Title;                        /* Hailing text */
  191.     char    *Dir;                        /* Directory array (DSIZE+1) */
  192.     char    *File;                        /* Filename array (FCHARS+1) */
  193.  
  194.     char    *PathName;                    /* Complete path name array (DSIZE+FCHARS+2) */
  195.  
  196.     struct Window    *Window;            /* Window requesting or NULL */
  197.  
  198.  
  199.     UWORD    MaxExtendedSelect;            /* Zero implies a maximum of 65535, as long as FRQEXTSELECT is set.*/
  200.     UWORD    numlines;                    /* Number of lines in file window. */
  201.     UWORD    numcolumns;                    /* Number of columns in file window. */
  202.     UWORD    devcolumns;
  203.     ULONG    Flags;                        /* Various - umm - flags.  See above for more info. */
  204.     UWORD    dirnamescolor;            /* These five colors will all default */
  205.     UWORD    filenamescolor;            /* to color one if you don't specify */
  206.     UWORD    devicenamescolor;        /* a color (ie; if you specify color zero). */
  207.     UWORD    fontnamescolor;            /* If you want color zero to be used, specify */
  208.     UWORD    fontsizescolor;            /* color 32, or some other too large number */
  209.                                     /* which mods down to zero. */
  210.  
  211.     UWORD    detailcolor;            /* If both of these colors are specified as */
  212.     UWORD    blockcolor;                /* zero then the block pen will be set to one. */
  213.  
  214.     UWORD    gadgettextcolor;        /* The color for the text of the five boolean gadgets.  Defaults to 1. */
  215.     UWORD    textmessagecolor;        /* The color for the message at the screen top.  Defaults to 1. */
  216.     UWORD    stringnamecolor;        /* The color for the words Drawer, File, Hide and Show.  Defaults to 3. */
  217.     UWORD    stringgadgetcolor;        /* The color for the borders of the string gadgets.  Defaults to 3. */
  218.                                     /* Unfortunately it is not possible to specify */
  219.                                     /* the color of the actual text in an Intuition */
  220.                                     /* string gadget. */
  221.     UWORD    boxbordercolor;            /* The color for the boxes around the file and directory areas.  Defaults to 3. */
  222.     UWORD    gadgetboxcolor;            /* The color for the boxes around the five boolean gadgets.  Defaults to 3. */
  223.  
  224.     UWORD    FRU_Stuff[18];                /* This area, which is reserved for */
  225.                                         /* future use, should all be zero. */
  226.  
  227.     struct DateStamp    DirDateStamp;    /* A copy of the cached directories date stamp. */
  228.                                         /* There should never be any need to change this. */
  229.  
  230.     UWORD    WindowLeftEdge;            /* These two fields are only used when the */
  231.     UWORD    WindowTopEdge;            /* FRQABSOLUTEXY flag is set.  They specify */
  232.                                     /* the location of the upper left hand */
  233.                                     /* corner of the window. */
  234.  
  235.     UWORD    FontYSize;                /* These fields are used to return the selected */
  236.     UWORD    FontStyle;                /* font size and style, only applicable when the */
  237.                                     /* font bit is set. */
  238.  
  239.     /*If you set the extended select bit and the user extended selects, the list of filenames will start from here.*/
  240.     struct ESStructure *ExtendedSelect;
  241.     char    Hide[WILDLENGTH+2];        /* The wildcards text. */
  242.     char    Show[WILDLENGTH+2];        /* More wildcards text. */
  243.     WORD    FileBufferPos;            /* Various fields taken from the various */
  244.     WORD    FileDispPos;            /* string gadgets so that the cursor */
  245.     WORD    DirBufferPos;            /* can be returned to the same position */
  246.     WORD    DirDispPos;                /* on subsequent calls. */
  247.     WORD    HideBufferPos;
  248.     WORD    HideDispPos;
  249.     WORD    ShowBufferPos;
  250.     WORD    ShowDispPos;
  251.  
  252. /**;      The  following  fields are PRIVATE!  Don't go messing with them or
  253. ; wierd  things may/will happen.  If this isn't enough of a warning, go read
  254. ; the one in intuition.h, that should scare you off.**/
  255.  
  256.     APTR    Memory;                        /* Memory allocate for dir entries. */
  257.     APTR    Memory2;                    /* More memory, used for hidden files. */
  258.     APTR    Lock;
  259.     char    PrivateDirBuffer[DSIZE+2];    /* Used for keeping a record of which */
  260.                                         /* directory we have file names for. */
  261.     struct FileInfoBlock    *FileInfoBlock;
  262.     WORD    NumEntries;
  263.     WORD    NumHiddenEntries;
  264.     WORD    filestartnumber;
  265.     WORD    devicestartnumber;
  266.     };
  267.  
  268.  
  269.  
  270. /*        This is used with the RealTimeScroll function. */
  271.  
  272. struct ScrollStruct
  273.      {
  274.     ULONG    TopEntryNumber;            /*;This is the ordinal number of the first*/
  275.                                     /*;displayed entry.*/
  276.     ULONG    NumEntries;                /*;This is the total number of entries in*/
  277.                                     /*;the list.*/
  278.     UWORD    LineSpacing;            /*;This is how many pixels high each entry is.*/
  279.     ULONG    NumLines;                /*;This is how many entries can be displayed simultaneously.*/
  280.     struct Gadget    *PropGadget;    /*;This is a pointer to the prop gadget being monitored.*/
  281.  
  282.     void    (*RedrawAll)();            /*;This routine is used to redraw all of the*/
  283.                                     /*;entries when the user moves far enough*/
  284.                                     /*;that scrolling will take too long.*/
  285.  
  286.     void    (*ReadMore)();            /*;An optional routine that is called when*/
  287.                                     /*;the scroll routine is waiting for movement.*/
  288.                                     /*;This allows reading of new data while real*/
  289.                                     /*;time scrolling.*/
  290.     void    (*ScrollAndDraw)();        /*;This routine is called when the data needs*/
  291.                                     /*;to be scrolled and updated.  This routine is*/
  292.                                     /*;passed four long parameters (on the stack and*/
  293.                                     /*;in D0-D3) which are, respectively:*/
  294.                                     /*;D0 - entry number of first line to be drawn.*/
  295.                                     /*;D1 - pixel offset to draw first line at.*/
  296.                                     /*;D2 - amount to scroll before doing any drawing.*/
  297.                                     /*;D3 - number of lines of data to draw.*/
  298.     WORD    versionnumber;            /*;Make SURE this is set to zero. */
  299.     LONG    rfu1;                    /*;Make SURE you leave these two zeroed also. */
  300.     LONG    rfu2;                    /*;Make SURE you leave these two zeroed also. */
  301.     };
  302.  
  303.  
  304.  
  305.  
  306.  
  307. struct chipstuff
  308.     {
  309.     char    ArrowUp[20];        /* 16 pixels wide, 10 pixels high. */
  310.     char    ArrowDown[20];        /* 16 pixels wide, 10 pixels high. */
  311.     char    ArrowLeft[18];        /* 16 pixels wide, 9 pixels high. */
  312.     char    ArrowRight[18];        /* 16 pixels wide, 9 pixels high. */
  313.     char    Letter_R[20];        /* 16 pixels wide, 10 pixels high. */
  314.     char    Letter_G[20];        /* 16 pixels wide, 10 pixels high. */
  315.     char    Letter_B[20];        /* 16 pixels wide, 10 pixels high. */
  316.     char    Letter_H[20];        /* 16 pixels wide, 10 pixels high. */
  317.     char    Letter_S[20];        /* 16 pixels wide, 10 pixels high. */
  318.     char    Letter_V[20];        /* 16 pixels wide, 10 pixels high. */
  319.     };
  320.  
  321. struct ReqLib
  322.     {
  323.     struct Library RLib;
  324.     struct AbsExecBase        *SysLib;
  325.     struct DosBase            *DosLib;
  326.     struct IntuitionBase    *IntuiLib;
  327.     struct GfxBase            *GfxLib;
  328.     APTR                    SegList;
  329.     struct chipstuff        *Images;
  330.     BYTE                    Flags;
  331.     BYTE                    Pad;
  332.     char                    *ConsoleDev;    /* Not really a char*, but it should work */
  333.     struct    IOStdReq        *ConsoleHandle;
  334.     };
  335.  
  336.  
  337. #endif
  338.